<!-- $Id: sms_send_ui.htm 16697 2009-09-24 03:57:47Z liuhui $ -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title>ECSHOP 管理中心 - 发送邮箱 </title>
<base href="__ROOT__/admin/"/>
<link href="styles/general.css" rel="stylesheet" type="text/css">
<link href="styles/main.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src=".js/transport.js"></script>
<script type="text/javascript" src=".js/common.js"></script>
<style>
  .panel-icloud .panel-right iframe {
    height: 300px;
    margin-top: 15px;
  }
  .panel-hint{
    top: 0%;
  }

  .container{  
     width:450px;  
     border:1px solid #6C9C2C;  
     height:25px;  
   }
  #bar{  
     background:#95CA0D;  
     float:left; 
     height:100%;  
     text-align:center;  
     line-height:150%; 
   }  
</style>

<script>
<!--
// 这里把JS用到的所有语言都赋值到这里
var process_request = "正在处理您的请求...";
var todolist_caption = "记事本";
var todolist_autosave = "自动保存";
var todolist_save = "保存";
var todolist_clear = "清除";
var todolist_confirm_save = "是否将更改保存到记事本？";
var todolist_confirm_clear = "是否清空内容？";
var password_empty_error = "密码不能为空。";
var username_empty_error = "用户名不能为空。";
var username_format_error = "用户名格式不对。";
var domain_empty_error = "域名不能为空。";
var domain_format_error = "域名格式不对。";
var send_empty_error = "发送邮箱号与发送等级至少填写一项！";
var sms_empty_error = "短信内容长度不为空";
var phone_empty_error = "请填写手机号。";
var phone_format_error = "手机号码格式不对。";
var msg_empty_error = "请填写消息内容。";
var send_date_format_error = "定时发送时间格式不对。";
var start_date_format_error = "开始日期格式不对。";
var end_date_format_error = "结束日期格式不对。";
var money_empty_error = "请输入您要充值的金额。";
var money_format_error = "金额格式不对。";
//-->
/*关闭按钮*/
  function get_certificate(){
	  var panel = document.getElementById('panelCloud');
	  var mask  = document.getElementById('CMask')||null;
	  var frame = document.getElementById('CFrame');
	  if(panel&&CMask&&frame){
	      panel.style.display = 'block';
	      mask.style.display = 'block';
	      frame.src = 'https://openapi.shopex.cn/oauth/authorize?response_type=code&client_id=yogfss4l&redirect_uri=http%3A%2F%2Flocalhost%2Fdayi%2Fecshopceshi%2Fecshop%2Fadmin%2Fcertificate.php%3Fact%3Dget_certificate%26type%3Dindex&view=auth_ecshop';
	    }
	}

	/*关闭按钮*/
	function btnCancel(item){
	  var par  = item.offsetParent;
	  var mask  = document.getElementById('CMask')||null;
	  var frame = document.getElementById('CFrame');
	  par.style.display = 'none';
	  if(mask){mask.style.display = 'none';}
	  frame.src = '';
	}
</script>
</head>
<body>
<!--云起激活系统面板-->
<div class="panel-hint panel-icloud" id="panelCloud">
  <div class="panel-cross"><span onclick="btnCancel(this)">Ｘ</span></div>
  <div class="panel-title">
    <span class="tit">您需要激活系统</span>
    <p>用云起账号激活您的系统，享受物流查询，天工收银，手机短信等更多应用和服务</p>
  </div>
  <div class="panel-left">
    <span>没有云起账号吗？</span>
    <p>点击下列按钮一步完成注册激活！</p>
    <a href="https://account.shopex.cn/reg?refer=yunqi_ecshop" target="_blank" class="btn btn-yellow">免费注册云起账号</a>
  </div>
  <div class="panel-right">
    <h5 class="logo">云起</h5>
    <p>正在激活中</p>
    <iframe src="" id="CFrame" frameborder="0"></iframe>
    <div class="cloud-passw">
      <a target="_blank" href="https://account.shopex.cn/forget?">忘记密码？</a>
    </div>
  </div>
</div>
<!--云起激活系统面板-->
<!--遮罩-->
<div class="mask-black" id="CMask"></div>
<!--遮罩-->
<h1>
    
    <span class="action-span1"><a href="http://localhost/dayi/ecshopceshi/ecshop/admin/index.php?act=main">ECSHOP 管理中心</a> </span><span id="search_id" class="action-span1">&nbsp;&nbsp;&gt;&nbsp;&nbsp;发送邮箱 </span>
  <div style="clear:both"></div>
</h1>
<div class="main-div" id="sms-send">

<table>
  <tbody><tr>
    <td class="label">商品链接:</td>
    <td><input name="goodsurl" size="35" type="text" id="goodsurl">
        一定要添加正确的链接   </td>
  </tr>
    <tr>
    <td class="label">按用户等级发送短消息:</td>
    <td><select name="send_rank" id='send_rank'>
        <option value="0" selected="selected">请选择会员等级</option> 
          <option value="1">注册用户</option>    
          <option value="2">全体会员</option>     
         </select></td>
  </tr>
  <tr>
    <td class="label">邮件内容:</td>
    <td><textarea name="msg" rows="6" cols="32" id="sms_content"></textarea><span class="require-field">*</span> 每条邮箱最长67字符，签名已经默认，不需要添加签名。（如未设置签名点击 <a href="http://localhost/dayi/ecshopceshi/ecshop/admin/sms.php?act=sms_sign">设置</a>）</td>
  </tr>

  <tr>
    <td class="label"></td>
    <!-- <td style="color:red;">内容里请不要出现"test"或者"测试"这样的字眼，否则可能会被运营商拦截</td> -->
    <td>已输入<span style="font-size:18px;font-style:italic;color:blue;" id="notice-word">0</span>个字符，约 <b id="sms_num" style="font-size:18px;font-style:italic;color:red;">0</b> 条邮箱长度 邮箱内容的实际长度以最终发出的结果为准 </td>
  </tr>

  <tr>
    <td class="label">邮件预览：</td>
    <td id="preview"></td>
  </tr>

  <tr>
    <td><input name="sms_type" value="fan-out" type="hidden"></td>
  </tr>
  
  <tr>
    <td colspan="2" align="center">
      <button class="button">确定</button>
      <input value=" 重置 " class="button" type="reset">
    </td>
  </tr>
</tbody></table>
</form>
</div>


<center>
     发送进度：
     <div class="container"> 
         <div id="bar" style="width:0%;"></div>  
     </div>  
     <span id="total"></span> 

</center>


<script src="./js/jquery-2.1.4.min.js"></script>
<script>
        $(document).on('click','.button',function(){

            var goodsurl=$("#goodsurl").val();
            var senduser =$('#send_rank').val();
            var content=$('#sms_content').val();
            if(goodsurl==''){
                alert('对不起链接地址不正确');return false;
            }
            if(senduser==0){
                alert('对不起请选择发送人员');return false;
            }
            if(content==''){
                alert('对不起内容不正确');return false;
            }
            run();
            $.ajax({
                url:"{:url('Email/send')}",
                type:"post",
                data:{goodsurl:goodsurl,senduser:senduser,content,content},
                success:function(msg){         
                  if(msg){ 
                    if(msg==1){
                        alert('发送完成,点击完成');
                        window.location.href="{:url('Email/sendmail')}";
                    }else{
                      alert(msg);
                    }           
                 
                  }else{
                     alert('发送邮箱失败');return false;
                  }
                }  

            })


        })

    function run(){  
        var bar = document.getElementById("bar"); 
        var total = document.getElementById("total"); 
          bar.style.width=parseInt(bar.style.width) + 1 + "%";  
          total.innerHTML = bar.style.width; 

          if(bar.style.width == "100%"){  
            window.clearTimeout(timeout); 
            return; 
          } 
          var timeout=window.setTimeout("run()",100); 

      } 
   
</script>

































<script type="text/javascript" language="JavaScript">

window.onload = function(){

  var sms = document.getElementById('sms_content');
  var preview = document.getElementById('preview');
  sms.onkeyup = function(){
    msg = this.value;
    if (msg.length > 0) {
      msg = '亲，根据你的爱好，ecshop有一款新商品请您过目哦      ' + msg ;
      preview.setAttribute('style','border:1px solid #d8d8d8;background-color:cornsilk;margin:0 5px');
    }
    document.getElementById('notice-word').innerHTML = this.value.length;
    document.getElementById('sms_num').innerHTML = Math.ceil(msg.length/67);
    preview.innerText = msg;
  }
}

</script>
<div id="footer">
共执行 4 个查询，用时 0.011296 秒，Gzip 已禁用，内存占用 1.479 MB<br>
版权所有 © 2005-2018 上海商派软件有限公司，并保留所有权利。</div>
<script type="text/javascript" src="ECSHOP%20%E7%AE%A1%E7%90%86%E4%B8%AD%E5%BF%83%20-%20%E5%8F%91%E9%80%81%E7%9F%AD%E4%BF%A1_files/utils.js"></script><!-- 新订单提示信息 -->
<div id="popMsg">
  <table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#cfdef4">
  <tbody><tr>
    <td style="color: #0f2c8c" width="30" height="24"></td>
    <td style="font-weight: normal; color: #1f336b; padding-top: 4px;padding-left: 4px" width="100%" valign="center"> 新订单通知</td>
    <td style="padding-top: 2px;padding-right:2px" width="19" valign="center" align="right"><span title="关闭" style="cursor: hand;cursor:pointer;color:red;font-size:12px;font-weight:bold;margin-right:4px;" onclick="Message.close()">×</span><!-- <img title=关闭 style="cursor: hand" onclick=closediv() hspace=3 src="msgclose.jpg"> --></td>
  </tr>
  <tr>
    <td style="padding-right: 1px; padding-bottom: 1px" colspan="3" height="70">
    <div id="popMsgContent">
      <p>您有 <strong style="color:#ff0000" id="spanNewOrder">1</strong> 个新订单以及       <strong style="color:#ff0000" id="spanNewPaid">0</strong> 个新付款的订单</p>
      <p style="word-break:break-all" align="center"><a href="http://localhost/dayi/ecshopceshi/ecshop/admin/order.php?act=list"><span style="color:#ff0000">点击查看新订单</span></a></p>
    </div>
    </td>
  </tr>
  </tbody></table>
</div>

<!--
<embed src="images/online.wav" width="0" height="0" autostart="false" name="msgBeep" id="msgBeep" enablejavascript="true"/>
-->
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" id="msgBeep" width="1" height="1">
  <param name="movie" value="images/online.swf">
  <param name="quality" value="high">
  <embed src="ECSHOP%20%E7%AE%A1%E7%90%86%E4%B8%AD%E5%BF%83%20-%20%E5%8F%91%E9%80%81%E7%9F%AD%E4%BF%A1_files/online.swf" name="msgBeep" id="msgBeep" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash" width="0" height="0">
  
</object>

<script language="JavaScript">
document.onmousemove=function(e)
{
  var obj = Utils.srcElement(e);
  if (typeof(obj.onclick) == 'function' && obj.onclick.toString().indexOf('listTable.edit') != -1)
  {
    obj.title = '点击修改内容';
    obj.style.cssText = 'background-color: #eee;';
    obj.onmouseout = function(e)
    {
      this.style.cssText = '';
    }
  }
  else if (typeof(obj.href) != 'undefined' && obj.href.indexOf('listTable.sort') != -1)
  {
    obj.title = '点击对列表排序';
  }
}
<!--


var MyTodolist;
function showTodoList(adminid)
{
  if(!MyTodolist)
  {
    var global = $import("../js/global.js","js");
    global.onload = global.onreadystatechange= function()
    {
      if(this.readyState && this.readyState=="loading")return;
      var md5 = $import("js/md5.js","js");
      md5.onload = md5.onreadystatechange= function()
      {
        if(this.readyState && this.readyState=="loading")return;
        var todolist = $import("js/todolist.js","js");
        todolist.onload = todolist.onreadystatechange = function()
        {
          if(this.readyState && this.readyState=="loading")return;
          MyTodolist = new Todolist();
          MyTodolist.show();
        }
      }
    }
  }
  else
  {
    if(MyTodolist.visibility)
    {
      MyTodolist.hide();
    }
    else
    {
      MyTodolist.show();
    }
  }
}

if (Browser.isIE)
{
  onscroll = function()
  {
    //document.getElementById('calculator').style.top = document.body.scrollTop;
    document.getElementById('popMsg').style.top = (document.body.scrollTop + document.body.clientHeight - document.getElementById('popMsg').offsetHeight) + "px";
  }
}

if (document.getElementById("listDiv"))
{
  document.getElementById("listDiv").onmouseover = function(e)
  {
    obj = Utils.srcElement(e);

    if (obj)
    {
      if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode;
      else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode;
      else return;

      for (i = 0; i < row.cells.length; i++)
      {
        if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#F4FAFB';
      }
    }

  }

  document.getElementById("listDiv").onmouseout = function(e)
  {
    obj = Utils.srcElement(e);

    if (obj)
    {
      if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode;
      else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode;
      else return;

      for (i = 0; i < row.cells.length; i++)
      {
          if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#FFF';
      }
    }
  }

  document.getElementById("listDiv").onclick = function(e)
  {
    var obj = Utils.srcElement(e);

    if (obj.tagName == "INPUT" && obj.type == "checkbox")
    {
      if (!document.forms['listForm'])
      {
        return;
      }
      var nodes = document.forms['listForm'].elements;
      var checked = false;

      for (i = 0; i < nodes.length; i++)
      {
        if (nodes[i].checked)
        {
           checked = true;
           break;
         }
      }

      if(document.getElementById("btnSubmit"))
      {
        document.getElementById("btnSubmit").disabled = !checked;
      }
      for (i = 1; i <= 10; i++)
      {
        if (document.getElementById("btnSubmit" + i))
        {
          document.getElementById("btnSubmit" + i).disabled = !checked;
        }
      }
    }
  }

}

//-->
</script>

</body></html>